import { requestClient } from '#/api/request';


//查询
export async function getOrgTreeApi(params: any) {
  return requestClient.get('/certification/get-cert-org-page', { params });
}

// 根据认证id获取可以参加考试的组织（剔除掉已经存在考试的组织）
export async function getCertOrgByCertIdApi(params: any) {
  return requestClient.get('/certification/get-cert-org-by-certId', { params });
}

// 添加
export async function createOrgApi(data: any) {
  return requestClient.post('/certification/create-cert-org', data);
}

// 修改
export async function updateOrgApi(data: any) {
  return requestClient.patch('/certification/update-cert-org', data);
}

// 更新状态
export async function updateStatusApi(data: any) {
  return requestClient.patch('/certification/update-cert-org-status', data);
}

//删除
export async function deleteOrgApi(id:any) {
  return requestClient.delete(`/certification/delete-cert-org/${id}`);
}

// 上传文件
export async function uploadTplFileApi(data:any) {
  return requestClient.post('/*', data)
}

// 根据认证ID获取可用的组织列表
export async function getOrgTreeFilterCertApi(params: any) {
  return requestClient.get('/certification/get-org-tree-filter-cert', { params });
}

// 查询分组列表
export async function getGroupOrgCertTreeApi(params: any) {
  return requestClient.get('/certification/get-group-orgCert-tree', { params });
}

// 添加分组
export async function createGroupOrgApi(data: any) {
  return requestClient.post('/certification/create-group-orgCert', data);
}

// 修改分组
export async function updateGroupOrgApi(data: any) {
  return requestClient.patch('/certification/update-group-orgCert', data);
}

// 修改分组状态
export async function updateGroupOrgStatusApi(data: any) {
  return requestClient.patch('/certification/update-group-orgCert-status', data);
}
